﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Pitis_Cristian_E214A
{
    class clientPool
    {

        private List<client> lista_clienti=new List<client> ();

        public client GetClient(string nume,int v)
        {

            foreach (client c  in lista_clienti)
                if (nume == c.get_nume() && v== c.get_varsta())
                    return c;
            //daca nu-l gaseste cream un client nou si-l adaugam in lista
            client c1 = new client();

            c1.set_nume(nume);
            c1.set_varsta(v);

            lista_clienti.Add(c1);

            return c1;
        }

        }
}
